

#### This archive replicates the results reported in "Trade Politics at the Checkout Lane – Ethnocentrism and Consumer Preferences"
#### Alexa Bankert, Ryan Powers, and Geoff Sheagley 
#### Jul 11, 2022


################################################################

## COMPUTING ENVIRONMENT 

The analysis code is written in R (4.1.2) and Stata (16.1). 

# R session information

R version 4.1.2 (2021-11-01)Platform: aarch64-apple-darwin20 (64-bit)Running under: macOS Monterey 12.3Matrix products: defaultLAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dyliblocale:[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8attached base packages:[1] grid      stats     graphics  grDevices utils     datasets  methods   base     other attached packages: [1] janitor_2.1.0      qwraps2_0.5.2      data.table_1.14.2  readstata13_0.10.0 cjoint_2.1.0       survey_4.1-1       survival_3.2-13    [8] Matrix_1.3-4       lmtest_0.9-39      zoo_1.8-9          sandwich_3.0-1     cregg_0.4.0        forcats_0.5.1      stringr_1.4.0     [15] dplyr_1.0.9        purrr_0.3.4        readr_2.1.2        tidyr_1.2.0        tibble_3.1.7       ggplot2_3.3.6      tidyverse_1.3.1   loaded via a namespace (and not attached): [1] Rcpp_1.0.8.3     lubridate_1.8.0  lattice_0.20-45  assertthat_0.2.1 digest_0.6.29    utf8_1.2.2       mime_0.12        R6_2.5.1         [9] cellranger_1.1.0 backports_1.4.1  reprex_2.0.1     ggstance_0.3.5   highr_0.9        httr_1.4.3       pillar_1.7.0     rlang_1.0.2     [17] readxl_1.3.1     rstudioapi_0.13  labeling_0.4.2   splines_4.1.2    munsell_0.5.0    shiny_1.7.1      broom_0.7.12     xfun_0.30       [25] compiler_4.1.2   httpuv_1.6.5     modelr_0.1.8     pkgconfig_2.0.3  htmltools_0.5.2  mitools_2.4      tidyselect_1.1.2 fansi_1.0.3     [33] crayon_1.5.1     tzdb_0.2.0       dbplyr_2.1.1     withr_2.5.0      later_1.3.0      jsonlite_1.8.0   xtable_1.8-4     gtable_0.3.0    [41] lifecycle_1.0.1  DBI_1.1.2        magrittr_2.0.3   scales_1.2.0     cli_3.3.0        stringi_1.7.6    farver_2.1.0     fs_1.5.2        [49] promises_1.2.0.1 snakecase_0.11.0 xml2_1.3.3       ellipsis_0.3.2   generics_0.1.2   vctrs_0.4.1      tools_4.1.2      glue_1.6.2      [57] hms_1.1.1        fastmap_1.1.0    colorspace_2.0-3 rvest_1.0.2      knitr_1.39       haven_2.4.3     > 

################################################################

## Archive Layout

-- ResultsReportedInManuscript.R - Creates Figure 1 and other reported statistics in the paper.
-- ResultsReportedInManuscript.log -  Log of ResultsReportedInManuscript.R as run by the authors. 
-- final_w1w2.dta - Dataset for main analyses
-- readme.txt - this file

./Appendix:
--- Appendix.R - Creates Figures A2, A3, A4, A5, A7 and Tables A1, A2, A5 and A6. 
--- Appendix.log - Log of Appendix.R as run by the authors. 

./CCES
--- cces.dta - Data for demographic distribution comparison to Cooperative Congressional Election Study in Table A2

./Appendix/Figure A6:
--- FigureA6.R - Creates Figure A6 in the online appendix.
--- FigureA6.log - Log of Appendix.R as run by the authors. 
--- lucid_formatted.dta - Dataset needed to create figure A6.

./Appendix/TableA4:
--- TableA4.do - Creates Table A4. 
--- TableA4.log - Log of TableA4.do as run by the authors.

./Appendix/TablesA7A8:
--- TablesA7A8.do - Creates Tables A7 and A8. 
--- TablesA7A8.log - Log of TablesA7A8.do as run by the authors. 


*** Note that Table A3 in the Appendix is a manually created summary our our research design and Figure A1 is a screenshot from our survey instrument. No replication code for either. 


